[anchor-position] Support testing of polyfill #47156
Open
+19
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm contributing to the polyfill for anchor position, which we test against the WPT. When testing the polyfill, we need to add a bit of delay to ensure the polyfill is applied before testing.
In #38442, a
checkLayoutForAnchorPos
wrapper forcheckLayout
was added to support a way to add a delay only for the polyfill while not impacting other tests. We don't have a similar method fortest
, so we have some false negatives when testing the polyfill.testForAnchorPos
is intended to replace all instances oftest
andpromise_test
in the Anchor Position tests. It likely would work forasync_test
as well, but I'm not seeing any instances of that in the Anchor Position tests. LikecheckLayoutForAnchorPos
, this only adds a delay if a globalCHECK_LAYOUT_DELAY
is true AND we are testing with--injected-script
. This should have no impact on non-polyfill tests.I've applied this to
css/css-anchor-position/pseudo-element-anchor.html
, and if this strategy is acceptable, I will transition the other tests as well.